<style>
.web-iframe {
  height: 500px;
}
</style>

<template>
  <div>
    <div>111111111111111</div>

    <z-canvas-draw></z-canvas-draw>
    <div>
      <el-button @click="printScreen">截屏</el-button>
    </div>
  </div>
</template>

<script>
import ScreenShort from "js-web-screen-shot";
import ZCanvasDraw from "@example/views/format/component/ZCanvasDraw";
export default {
  components: {ZCanvasDraw},
  data() {
    return {

    }
  },
  mounted() {
  },
  methods: {
    printScreen() {
      // 截图确认按钮回调函数
      const callback = (base64) =>{
        console.log(base64);
      }
      // 截图取消时的回调函数
      const closeFn = ()=>{
        console.log("截图窗口关闭");
      }
      new ScreenShort({
        enableWebRtc: true,
        completeCallback: callback,
        closeCallback: closeFn
      });
    }
  }
}
</script>
